/****************************************************************************

	COPYRIGHT(C) MAXSI SOFTWARE, JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010

    This file is part of Maxsi Distribution.

    Maxsi Distribution is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Maxsi Distribution is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Maxsi Distribution. If not, see <http://www.gnu.org/licenses/>.

	*/ #include "MaxsiDistributionContributors.h" /*

	If you modify this file, please enter your name below and provide contact
	information in MaxsiDistributionContributors.h. For more information please see
	MaxsiDistributionContributors.h.
	
	Contributors to this file:

	- Jonas 'Sortie' Termansen
	- [your name here]

	MaxsiDistribution.dll
	Distributing since 2008

	Interface.h
	Forward-declarations of all interfaces provided in this Maxsi Distribution
	Dynamic-Link Library.

****************************************************************************/

#ifndef Interfaces_H
#define Interfaces_H

//=============================================================================
//	Defines the current interface version. This calling system should not be
//	changed by other than Maxsi Software - while you technically are allowed to
//	do thism it's much better if we do this together - so that ALL versions of
//	Maxsi Distribution remains FULLY COMPATIBLE. If you create a version that
//	isn't combatible, contact Maxsi Software and we'll assign you a version number.
//	But please - make sure your changes are compatible with ALL other versions
//	of Maxsi Distribution.
//  Please see http://www.maxsi.dk/developer/index.php?title=Interfaces
//=============================================================================

//// Maxsi Distribution SDK Callback Interface
//#define	MaxsiDistributionClass						MaxsiDistributionClass001
//#define MAXSIDISTRIBUTION_CLASS_VERSION				"MaxsiDistributionClass001"
//
//// Maxsi Distribution Interface
//#define	MaxsiDistributionInterface					MaxsiDistributionInterface001
//#define MAXSIDISTRIBUTION_INTERFACE_VERSION			"MaxsiDistributionInterface001"
//
//// Maxsi Distribution Module Interface
//#define	MaxsiDistributionModule						MaxsiDistributionModule001
//#define MAXSIDISTRIBUTIONMODULE_INTERFACE_VERSION	"MaxsiDistributionModuleInterface001"
//
//// Maxsi Achievements
//#define	MaxsiAchievementsInterface					MaxsiAchievementsInterface001
//#define MAXSIACHIEVEMENTS_INTERFACE_VERSION			"MaxsiAchievementsInterface001"
//
//// Maxsi Achievement Data Class
//#define	MaxsiAchievement							MaxsiAchievement001
//#define MAXSIACHIEVEMENT_INTERFACE_VERSION			"MaxsiAchievement001"

//=============================================================================
//	Useful helper macros!
//=============================================================================
#define MD_DECLARE_INTERFACE_H(InterfaceClass) void*	__cdecl	Get##InterfaceClass(char* Version);
#define MD_DECLARE_INTERFACE(InterfaceClass, InterfaceName) \
	InterfaceClass*		I_##InterfaceClass	=	NULL; \
	void*	__cdecl	Get##InterfaceClass(char* Version) \
	{ \
		if ( I_##InterfaceClass == NULL ) \
		{ \
			I_##InterfaceClass	=	new InterfaceClass; \
		} \
		return (void*)I_##InterfaceClass; \
	}

//=============================================================================
//	Forward-Declare all Interfaces
//=============================================================================
class MaxsiDistributionClass001;
class MaxsiDistributionInterface001;
class MaxsiDistributionModule001;
class MaxsiAchievementsInterface0001;
class MaxsiAchievement001;

//=============================================================================
//	Declare a SHA1 data structure
//=============================================================================
class SHA1_t
{
public:
	unsigned __int32 Hash[5];

public:
	SHA1_t()
	{
		// Default to the hash of an empty string.
		Hash[0]		=	0xDA39A3EE;
		Hash[1]		=	0x5E6B4B0D;
		Hash[2]		=	0x3255BFEF;
		Hash[3]		=	0x95601890;
		Hash[4]		=	0xAFD80709;
	}

	SHA1_t(	unsigned __int32 Hash1, 
			unsigned __int32 Hash2,
			unsigned __int32 Hash3,
			unsigned __int32 Hash4,
			unsigned __int32 Hash5)
	{
		Hash[0]		=	Hash1;
		Hash[1]		=	Hash2;
		Hash[2]		=	Hash3;
		Hash[3]		=	Hash4;
		Hash[4]		=	Hash5;
	}

public:
	inline bool operator==( const SHA1_t &val ) const
	{ 
		return (	Hash[0] == val.Hash[0] &&
					Hash[1] == val.Hash[1] && 
					Hash[2] == val.Hash[2] && 
					Hash[3] == val.Hash[3] && 
					Hash[4] == val.Hash[4] );
	} 

	inline bool operator!=( const SHA1_t &val ) const 
	{ 
		return (	Hash[0] != val.Hash[0] ||
					Hash[1] != val.Hash[1] || 
					Hash[2] != val.Hash[2] || 
					Hash[3] != val.Hash[3] || 
					Hash[4] != val.Hash[4] );
	} 
};

//=============================================================================
//	Include the include files for all interfaces provided in this DLL.
//=============================================================================
#include "MaxsiDistributionInterface001.h"
#include "MaxsiDistributionClass001.h"
#include "MaxsiDistributionModule001.h"
#include "MaxsiAchievements001.h"

//=============================================================================
//	Make sure all base classes point to the newest versions.
//=============================================================================
// Maxsi Distribution Module
#ifdef MaxsiDistributionModule
#undef MaxsiDistributionModule
#endif
#define MaxsiDistributionModule MaxsiDistributionModule001

// Maxsi Distribution Interface
#ifdef MaxsiDistributionInterface
#undef MaxsiDistributionInterface
#endif
#define MaxsiDistributionInterface MaxsiDistributionInterface001

#endif